package com.example.demo.mvvm.ui.fragment;

import android.os.Bundle;

import com.example.demo.mvvm.BR;
import com.example.demo.mvvm.R;
import com.example.demo.mvvm.databinding.FragmentChildrenBinding;
import com.example.demo.mvvm.ui.base.BaseFragment;
import com.example.demo.mvvm.ui.vm.fragment.ChildrenFragmentVm;

/**
 * Created by littlehu on 2018/5/19.
 */

public class ChildrenFragment extends BaseFragment<FragmentChildrenBinding> {

    public static ChildrenFragment newInstance(int id) {

        Bundle args = new Bundle();
        args.putInt("id" , id);
        ChildrenFragment fragment = new ChildrenFragment();
        fragment.setArguments(args);
        return fragment;
    }

    @Override
    protected void init() {
        databing.pullRefresh.autoRefresh();
        setViewVM(BR.viewModel , new ChildrenFragmentVm(getArguments().getInt("id" , 0) + ""));
    }

    @Override
    public int getLayoutId() {
        return R.layout.fragment_children;
    }


}
